package com.ruoyi.yanjing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yanjing.mapper.ElectricityPoleMapper;
import com.ruoyi.yanjing.domain.ElectricityPole;
import com.ruoyi.yanjing.service.IElectricityPoleService;

/**
 * 电杆信息Service业务层处理
 * 
 * @author whz
 * @date 2024-11-18
 */
@Service
public class ElectricityPoleServiceImpl implements IElectricityPoleService 
{
    @Autowired
    private ElectricityPoleMapper electricityPoleMapper;

    /**
     * 查询电杆线路信息列表
     *
     * @param electricityPole 电杆信息
     * @return 电杆信息
     */
    @Override
    public List<ElectricityPole> selectElectricityPoleAndLineInfoList(ElectricityPole electricityPole)
    {
        return electricityPoleMapper.selectElectricityPoleAndLineInfoList(electricityPole);
    }





    /**
     * 查询电杆信息
     * 
     * @param id 电杆信息主键
     * @return 电杆信息
     */
    @Override
    public ElectricityPole selectElectricityPoleById(String id)
    {
        return electricityPoleMapper.selectElectricityPoleById(id);
    }

    /**
     * 查询电杆信息列表
     * 
     * @param electricityPole 电杆信息
     * @return 电杆信息
     */
    @Override
    public List<ElectricityPole> selectElectricityPoleList(ElectricityPole electricityPole)
    {
        return electricityPoleMapper.selectElectricityPoleList(electricityPole);
    }


    /**
     * 查询所有网关设备id
     * @return
     */
    @Override
    public List<ElectricityPole> selectElectricityPoleGatewayIdList()
    {
        return electricityPoleMapper.selectElectricityPoleGatewayIdList();
    }






    /**
     * 新增电杆信息
     * 
     * @param electricityPole 电杆信息
     * @return 结果
     */
    @Override
    public int insertElectricityPole(ElectricityPole electricityPole)
    {
        electricityPole.setCreateTime(DateUtils.getNowDate());
        return electricityPoleMapper.insertElectricityPole(electricityPole);
    }

    /**
     * 修改电杆信息
     * 
     * @param electricityPole 电杆信息
     * @return 结果
     */
    @Override
    public int updateElectricityPole(ElectricityPole electricityPole)
    {
        electricityPole.setUpdateTime(DateUtils.getNowDate());
        return electricityPoleMapper.updateElectricityPole(electricityPole);
    }

    @Override
    public int batchUpdateElectricityPoleByIds(List<Long> poleIds)
    {

        return electricityPoleMapper.batchUpdateElectricityPoleByIds(poleIds);
    }


    /**
     * 批量删除电杆信息
     * 
     * @param ids 需要删除的电杆信息主键
     * @return 结果
     */
    @Override
    public int deleteElectricityPoleByIds(String[] ids)
    {
        return electricityPoleMapper.deleteElectricityPoleByIds(ids);
    }

    /**
     * 删除电杆信息信息
     * 
     * @param id 电杆信息主键
     * @return 结果
     */
    @Override
    public int deleteElectricityPoleById(String id)
    {
        return electricityPoleMapper.deleteElectricityPoleById(id);
    }
}
